package com.ufenlei.LTS {
	import flash.display.MovieClip;
	
	/**
	 * @author bbn
	 */
	public class LoadingBar extends MovieClip {
		private var loadBar:MovieClip;
		private var baseBar:MovieClip;
		private var lw:int;
		public function LoadingBar() {
			loadBar = loadbar;
			baseBar = basebar;
			lw = loadBar.width;
			init();
		}
		public function setProgress(byteLoaded:int,byteTotal:int):void{
			if( byteTotal>0 && byteTotal>byteLoaded){
				loadBar.scaleX = baseBar.width * byteLoaded/byteTotal/lw;
			}else{
				loadBar.scaleX = baseBar.width/lw;
			}
		}
		public function init():void{
			setProgress(0,100);
		}
	}
}
